<?php
/**
 * Searches in the database if all similar artists have their own record
 */
set_time_limit(6000000);
mysql_connect('sql.ewi.tudelft.nl','ikemusic2','1234567890');
mysql_select_db('ikemusic2');
$query='SELECT similar1, similar2,similar3,similar4,similar5 FROM Artist';
$result=  mysql_query($query);

while($row=  mysql_fetch_array($result)){
    for($i=0;$i<5;$i++){
        $query2='SELECT name FROM Artist WHERE LOWER(name)="'.strtolower($row[$i]).'"';
        $result2=mysql_query($query2);
        if(mysql_num_rows($result2)>0){

        }
        else{
            print($row[i]." ");
            mysql_query('INSERT INTO Missing (`name`) VALUES ("'.strtolower($row[$i]).'");');
        }
    }

}
?>
